import { axiosMock, delayFn } from '@/services/axiosMock'
import { IAddress, IOrderProductBoxInfo } from './interface'

axiosMock('default', mock => {
  // 获取地址消息
  mock.onPost(`/tmsapi/track_waybill/getAddressInfo`).reply(
    delayFn<IAddress>(0, () => {
      return {
        success: true,
        data: {
          destinationAddress: '领赫东莞仓',
          destinationCode: 'A002',
          destinationCountry: '美国',
          supplierAddress: 'MIT2',
          supplierCountry: '美国',
          supplierPhone: '071234666',
          supplierWarehouse: '领赫东莞仓2',
          waybillNo: 'LH0807AAAA',
        },
      }
    }),
  )
  // 获取产品箱信息
  mock.onPost(`/tmsapi/track_waybill/getOrderProductBoxInfo`).reply(
    delayFn<IOrderProductBoxInfo>(0, () => {
      return {
        success: true,
        data: {
          boxNum: 0,
          weight: '12',
          volume: '12',
        },
      }
    }),
  )
})
